#include "example.h"
using namespace std;
void example::setExample(int a, int b)
{
    this->node.a = a;
    this->node.b = b;
    // this->node->b = b;
    // this->_a = a;
    // this->_b = b;
    cotnum.push_back(node.a);
    cotnum.push_back(node.b);
}

vector<int> example::getExample()
{
    return cotnum;
}

void example::printInfo()
{
    std::cout << "a = " << node.a << std::endl;
    std::cout << "b = " << node.b << std::endl;
}

void example::forFunc()
{
    for (int i = 0; i < 10; i++)
    {
        if (i == 5)
            std::cout << "a half!" << std::endl;
        std::cout << "use the for  " << std::endl;
    }
}

void example::whileFun()
{
    int a = 5;
    while (a--)
        std::cout << "use the  while " << std::endl;
}

void example::switFun()
{
    int n;
    std::cout << "please input 1 or other number!" << std::endl;
    cin >> n;
    switch (n)
    {
    case 1:
        std::cout << "you are right!" << std::endl;
        break;

    default:
        std::cout << "you are wrong! " << std::endl;
        break;
    }
}